package bis;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;

public class BufferedInputStreamExample {
	public static void main(String[] args) {
		try {
			BufferedInputStream bis = new BufferedInputStream(new FileInputStream("a.txt"));
			
			BufferedOutputStream bos = new BufferedOutputStream(System.out);
			
			while(true) {
				int datum = bis.read();
				if(datum == -1) {
					break;
				}
				bos.write(datum);
			}
			bos.flush();
		}
		catch (Exception e) {
			System.out.print("No file");
		}
	}

}
